let util = require('../../../../../common/util/util')

Page({
    data: {
        use: []
    },

    onLoad: function (options) {
        this.xInit()
    },

    xInit: function () {
        let that = this
        wx.cloud.callFunction({
            name: 'consulting_message',
            data: {
                action: "get_user_list_for_message"
            }
        }).then(res => {
            console.log("返回数据:", res)
            let data = res.result
            for(var i in data){
                data[i].create_time = util.formatDate_chinese(new Date(data[i].create_time))
            }
            that.setData({
                use : data
            })
        })
    },

    xToDet : function (e) {
        let params = e.currentTarget.dataset
        console.log(params)
        wx.navigateTo({
            url: '/subdter/pages/mine/xtask/detail/index',
            success: (res) => {
                res.eventChannel.emit('xToDetail', params)
            }
        })
    }
})